package Practice.P01;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Practice01 {
    public static void main(String[] args) {
        // 随机点名的案例
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"小平平","小美美","小垃圾","大垃圾","小傻逼","大傻逼");
        Random r = new Random();
        int index = r.nextInt(list.size());
        String name = list.get(index);
        System.out.println(name);

        // 方式二：通过shuffle打乱操作
        Collections.shuffle(list);
        String name2 = list.get(0);
        System.out.println(name2);
    }
}
